﻿<%@ page language="C#" autoeventwireup="true" title="SSICA.ORG | Users" inherits="Account_Users, MainSite" masterpagefile="~/Site.master" %>

<asp:Content ID="contentBody" runat="server" ClientIDMode="Static" ContentPlaceHolderID="BodyContent">
    <div class="contentfull">
        <div class="breadcrumbs">
            <ul id="crumbs">
                <li><a title="My Account" href="/account/">My Account</a>
                    <img src="Content/Images/separator.png" alt="&rarr;" class="separator">
                    Users
                </li>
            </ul>
        </div>

        <div id="showMessages" runat="server" visible="false">
            <div class='success'>
                <p></p>
                <li>
                    <span id="mmsg" runat="server"></span>
                </li>
                <p></p>
            </div>
        </div>


        <div class="top">
            <div class="innerright">
                <a href="CreateUser.aspx" class="black_button bhuge" title="Create a Service">Create a User</a>
                <div class="need-help"><a href="HowTo/users.html" target="_blank">Need help creating a User?</a></div>

            </div>

            <div class="innerleft">
                <h1>Users</h1>
                <div class="lower_comment">
                    Order By:  
                    <a href="Users.aspx?order=time" style="font-weight: lighter; color: #999" id="dateSorter" runat="server">Creation Date</a>
                    <a href="Users.aspx?order=login" style="font-weight: lighter; color: #999;" id="loginSorter" runat="server">Last Login</a>
                    <a href="Users.aspx?order=alpha" style="font-weight: lighter; color: #999;" id="nameSorter" runat="server">Name</a>
                    <a href="Users.aspx?order=service" style="font-weight: lighter; color: #999;" id="serviceSorter" runat="server">Number of Services</a>

                    &nbsp;&nbsp;&nbsp;Show: 
					<a href="Users.aspx?show=all&order=time">All</a>
                </div>
            </div>
            <div class="pagination">
                <div class="scancount large center" id="userCount" runat="server"></div>
                <ul id="paginator1"></ul>
            </div>
        </div>
        <div class="content">
            <ul class="data">
            <asp:ListView ID="lstUsers" runat="server" ItemPlaceholderID="itemContainer">
                <LayoutTemplate>
                    <asp:PlaceHolder ID="itemContainer" runat="server"></asp:PlaceHolder>
                </LayoutTemplate>
                <ItemTemplate>
                    
                        <li class="group">
                            <p class="data_action">
                                <a href="#" title="View Scans">View Scans</a>
                                <a href="CreateUser.aspx?userid=<%#Eval("UserId")%>" title="Edit">Edit</a>
                                <a href="#" onclick=" javascript:if(confirm('Are you sure you want to delete this user? You will not be able to undo this action.')) location.href='DeleteUser.aspx?id=<%#Eval("UserId")%>';" class="a_delete_database">Delete</a>
                            </p>
                            <img src="Images/user-normal.png" class="dataicon" alt="User" /><h1>
                                <a href="CreateUser.aspx?userid=<%#Eval("UserId")%>" title="View User" id="username"><%#Eval("UserName")%></a></h1>
                            <h2><strong>Password:</strong> <%#Eval("Password") %></h2>
                            <dl class="meta group">
                                <dt>
                                    <img src="Images/time16.png" class="attr" alt="Date Updated" /></dt>
                                <dd>Created on <%#Eval("CreateDate")%></dd>
                                <dt>
                                    <img src="Images/time16.png" class="attr" alt="Last Login" /></dt>
                                <dd>Last Login : <%#Eval("LastLogin")%></dd>
                                <dt>
                                    <img src="Images/service16.png" class="attr" alt="The user has been authorized for these services:" /></dt>
                                <dd title="The user is associated with these services.">
                                    <%-- <span class="numberOfServices">--%>
                                    <%# this.GetServiceCount(Eval("UserId").ToString()) %>

                                    <%-- </span>--%>
                                    <%--<span class="serviceList" style="display: none;">
                                       
                                    </span>
                                    <a class="sClickToShow" style="text-decoration: underline;">Click to show</a>--%>

                                </dd>
                            </dl>
                        </li>                    

                </ItemTemplate>
                <EmptyDataTemplate>
                    <div>
                        Sorry - No User Found
                    </div>
                </EmptyDataTemplate>
            </asp:ListView>
            </ul>
                <script type="text/javascript">
                $(document).ready(function () {
                    $("a.a_delete_user").click(function (event) {
                        return confirm('Are you sure you want to delete this user? You will not be able to undo this action.');
                    });


                    $("a.pClickToShow").each(function () {

                        $(this).click(function () {
                            $(this).hide();
                            $(this).siblings("span.password").fadeIn();
                        });

                    });

                    // check out codereadr.js, this sets up Jquery stuff for hiding and showing services.
                    setupClickToShowService();

                });
            </script>
            <div class="pagination">
                <ul id="paginator2"></ul>
            </div>

        </div>
    </div>
</asp:Content>
